home *** CD-ROM | disk | FTP | other *** search
- Path: news.halcyon.com!usenet
- From: normanb@halcyon.com (Norm Bryar)
- Newsgroups: comp.lang.c++
- Subject: Re: generic paramter to template question
- Date: Sun, 04 Feb 1996 23:34:04 GMT
- Organization: Northwest Nexus Inc.
- Message-ID: <4f3foh$7nq@news.halcyon.com>
- References: <4eumei$j82@qualcomm.com>
- NNTP-Posting-Host: blv-pm11-ip19.halcyon.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- nabbasi@qualcomm.com (Nasser Abbasi) wrote:
-
- >hi,
-
- >How can one give a template a parameter that is a value of generic type?
-
- >A template can take as paramter as a type, and also it can take a
- >parameter that is a variable of known type as in:
-
- >template<class T,int item> class foo{..}
-
- >but in the above the type of "item" is not generic. is there a way
- >to pass "item" above but let the user have its type as generic also (as
- >with T) ?
-
- >thanks
- >Nasser
-
- There shouldn't be anything preventing you from making all the
- parameterized types generic in a template.
-
- You've tried, say,
-
- template <class Container, class Item>
- class foo
- {
- };
-
- and couldn't get it to work?
- Your compiler vendor hasn't fully supported templates, I would think.
-
- --Norm
-
-